<include file="common:__head__"/>
<div class="permissions-tabs">
        <a class="role <if condition="$is_agent eq 2">tabs-bg</if>" href="{:U('Brand/index')}">全部</a>
        <a class="role <if condition="$is_agent eq 1">tabs-bg</if>" href="{:U('Brand/index',array('agent'=>1))}">代理品牌</a>
        <a class="role <if condition="$is_agent eq 0">tabs-bg</if>" " href="{:U('Brand/index',array('agent'=>0))}">非代理品牌</a>
</div>
<div class="permissions-content">
    <div class="permissions-le">
        <div class="add-msg">
            <a class="add-role" href="{:U('Brand/addbrand')}">新增品牌+</a>
            <div class="add-form">
                <form method="get" action="">

                    <input type="hidden" name="m" value="seller"/>
                    <input type="hidden" name="c" value="Brand"/>
                    <input type="hidden" name="a" value="index"/>
                    <input type="hidden" name="agent" value="{$is_agent}"/>

                    <div class="add-ipt">
                        <input placeholder="品牌名称..." type="text" name="b_name" class="add-name" value="<if condition="$b_name neq '' ">{$b_name}</if>" />
                        <button type="submit"></button>
                    </div>
                </form>
            </div>
        </div>
        <div class="permissions-table">
            <table border="0" width="100%">
                <thead>
                <tr>
                    <td>ID</td>
                    <td width="15%">品牌名称</td>
                    <td>返利方式</td>
                    <td>代理品牌</td>
                    <td>是否启用</td>
                    <td>品牌图片</td>
                    <td>品牌描述</td>
                    <td>操作</td>
                </tr>
                </thead>
                <tbody>
                <foreach name="brands" item="vo" key="k" >
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.b_name}</td>
                        <td>
                            <if condition="$vo['type_name'] neq ''">
                                {$vo['type_name']}
                            <else/>
                                无
                            </if>
                        </td>
                        <td>
                            <if condition="$vo['agent_brand'] eq 1">
                                是
                            <else/>
                                否
                            </if>
                        </td>
                        <td>
                            <if condition='$vo[status] eq 1'>
                                <span class="yes" onClick="changeTableVal2('brand','id','{$vo.id}','status',this)" ><i class="fa fa-check-circle"></i>是</span>
                                <else />
                                <span class="no" onClick="changeTableVal2('brand','id','{$vo.id}','status',this)" ><i class="fa fa-ban"></i>否</span>
                            </if>
                        </td>
                        <td>
                            <a href="{$vo['pic']}" target="_blank"><img src="{$vo['pic']}" style="width: 30px;"></a>
                        </td>
                        <td>{$vo['info']|cut_str='35',###}</td>
                        <td>

                            <a href="{:U('Brand/edit', array('id'=> $vo['id']))}" class="btn btn-blue">编辑</a>
                            <if condition="$vo['agent_brand'] eq 1">
                                <a href="{:U('Agent/rank', array('id'=> $vo['id']))}" class="btn btn-green">代理等级</a>
                            </if>
                        </td>
                    </tr>
                </foreach>
                </tbody>
            </table>
            {$page}
        </div>
    </div>
    <div class="permissions-ri">
        <a href="" class="permissions-help">帮助和服务</a>
    </div>

</div>
<include file="common:__foot__"/>